// 全局样式文件
@import './normalize.scss';

// 全局变量
:root {
  --primary-color: #409EFF;
  --success-color: #67c23a;
  --warning-color: #e6a23c;
  --danger-color: #f56c6c;
  --info-color: #909399;
  --text-primary: #303133;
  --text-regular: #606266;
  --text-secondary: #909399;
  --text-placeholder: #c0c4cc;
  --border-base: #dcdfe6;
  --border-light: #e4e7ed;
  --border-lighter: #ebeef5;
  --border-extra-light: #f2f6fc;
  --background-base: #f5f7fa;
}

// 基础样式
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
}

body {
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--background-base);
  overflow-x: hidden;
}

#app {
  height: 100%;
  width: 100%;
}

// 清除浮动
.clearfix::after {
  content: '';
  display: table;
  clear: both;
}

// 文字省略号
.text-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-ellipsis-2 {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

// 居中布局
.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.flex-start {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.flex-end {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

// 间距工具类
@for $i from 0 through 30 {
  .m-#{$i} { margin: #{$i}px !important; }
  .mt-#{$i} { margin-top: #{$i}px !important; }
  .mr-#{$i} { margin-right: #{$i}px !important; }
  .mb-#{$i} { margin-bottom: #{$i}px !important; }
  .ml-#{$i} { margin-left: #{$i}px !important; }
  .mx-#{$i} { margin-left: #{$i}px !important; margin-right: #{$i}px !important; }
  .my-#{$i} { margin-top: #{$i}px !important; margin-bottom: #{$i}px !important; }

  .p-#{$i} { padding: #{$i}px !important; }
  .pt-#{$i} { padding-top: #{$i}px !important; }
  .pr-#{$i} { padding-right: #{$i}px !important; }
  .pb-#{$i} { padding-bottom: #{$i}px !important; }
  .pl-#{$i} { padding-left: #{$i}px !important; }
  .px-#{$i} { padding-left: #{$i}px !important; padding-right: #{$i}px !important; }
  .py-#{$i} { padding-top: #{$i}px !important; padding-bottom: #{$i}px !important; }
}